package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarOrderMapper;
import com.ruoyi.system.domain.CarOrder;
import com.ruoyi.system.service.ICarOrderService;

/**
 * 订单列Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-09
 */
@Service
public class CarOrderServiceImpl implements ICarOrderService 
{
    @Autowired
    private CarOrderMapper carOrderMapper;

    /**
     * 查询订单列
     * 
     * @param id 订单列主键
     * @return 订单列
     */
    @Override
    public CarOrder selectCarOrderById(Long id)
    {
        return carOrderMapper.selectCarOrderById(id);
    }

    /**
     * 查询订单列列表
     * 
     * @param carOrder 订单列
     * @return 订单列
     */
    @Override
    public List<CarOrder> selectCarOrderList(CarOrder carOrder)
    {
        return carOrderMapper.selectCarOrderList(carOrder);
    }

    /**
     * 新增订单列
     * 
     * @param carOrder 订单列
     * @return 结果
     */
    @Override
    public int insertCarOrder(CarOrder carOrder)
    {
        carOrder.setCreateTime(DateUtils.getNowDate());
        return carOrderMapper.insertCarOrder(carOrder);
    }

    /**
     * 修改订单列
     * 
     * @param carOrder 订单列
     * @return 结果
     */
    @Override
    public int updateCarOrder(CarOrder carOrder)
    {
        carOrder.setUpdateTime(DateUtils.getNowDate());
        return carOrderMapper.updateCarOrder(carOrder);
    }

    /**
     * 批量删除订单列
     * 
     * @param ids 需要删除的订单列主键
     * @return 结果
     */
    @Override
    public int deleteCarOrderByIds(Long[] ids)
    {
        return carOrderMapper.deleteCarOrderByIds(ids);
    }

    /**
     * 删除订单列信息
     * 
     * @param id 订单列主键
     * @return 结果
     */
    @Override
    public int deleteCarOrderById(Long id)
    {
        return carOrderMapper.deleteCarOrderById(id);
    }
    
    /**  
     * @MethodName: getMoney
     * @Description: 算订单单月租金的方法
     * @date: 2024-09-28 13:49:37 
     */  
    public Object getMoney() {
      CarOrder carOder=new CarOrder();
      return "ok";
    }
}
